package com.yj.springbootaop.cglibproxy;

import org.springframework.cglib.proxy.Enhancer;

public class CglibProxyFactory {

    public static Object getProxyObject(Class clazz){
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(clazz);
//        enhancer.setInterfaces(clazz.getInterfaces());
        enhancer.setCallback(new MyMethodInterceptor());
        return enhancer.create();
    }
}
